<template>
  <z-modal
    :width="800"
    v-bind="modalOption"
    :okText="false"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form-model layout="horizontal" labelAlign="right" ref="ruleForm" :label-col="labelCol" :wrapper-col="wrapperCol" :model="form" :rules="validatorRules">
        <a-form-model-item label="IP地址" prop="ip">
          <a-input placeholder="请输入IP地址" v-model.trim="form.ip" :disabled="disableSubmit"/>
        </a-form-model-item>
        <a-form-model-item label="服务器名" prop="serverName">
          <a-input placeholder="请输入服务器名" v-model.trim="form.serverName" :disabled="disableSubmit"/>
        </a-form-model-item>
        <a-form-model-item label="服务器摘要" prop="serverSummary">
          <a-input placeholder="请输入服务器摘要" v-model.trim="form.serverSummary" :disabled="disableSubmit"/>
        </a-form-model-item>
        <a-form-model-item label="监控环境" prop="monitorEnv">
          <a-input placeholder="请输入监控环境" v-model.trim="form.monitorEnv" :disabled="disableSubmit"/>
        </a-form-model-item>
        <a-form-model-item label="监控分组" prop="monitorGroup">
          <z-dict-select-tag v-model="form.monitorGroup" :disabled="disableSubmit" dictCode="MI_MONITOR_GROUP"/>
        </a-form-model-item>
        <a-form-model-item label="机房位置" prop="serverLocation">
          <a-input placeholder="请输入监控环境" v-model.trim="form.serverLocation" :disabled="disableSubmit"/>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
  </z-modal>
</template>

<script>
import ModalFormMixin from '@/mixins/ModalFormMixin'
import ZDictSelectTag from '@/components/dict/ZDictSelectTag'
export default {
  name: 'ServerModal',
  mixins: [ModalFormMixin],
  components: {
    ZDictSelectTag
  },
  data() {
    return {
      validatorRules: {
        ip: [
          { required: true, message: '请输入IP地址!' }
        ]
      },
      url: {
        add: '/monitor-server/add',
        edit: '/monitor-server/edit'
      }
    }
  },
  methods: {
    addAfter() {
    }
  }
}
</script>
